package com.shop.cereshop.agent.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shop.cereshop.agent.page.user.CereAgentUserVO;
import com.shop.cereshop.agent.param.user.LoginDTO;
import com.shop.cereshop.agent.param.user.RegisterDTO;
import com.shop.cereshop.agent.param.user.UserAndPrivateDTO;
import com.shop.cereshop.commons.domain.agent.CereAgentPrivate;
import com.shop.cereshop.commons.domain.agent.CereAgentRole;
import com.shop.cereshop.commons.domain.agent.CereAgentUser;
import com.shop.cereshop.commons.exception.CoBusinessException;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

public interface CereAgentUserService extends IService<CereAgentUser> {
    CereAgentUserVO addAllUserInfo(String inviteCode, RegisterDTO registerDTO, String ip, CereAgentPrivate cereAgentPrivate) throws CoBusinessException;

    CereAgentUser selectCereAgentPrivateByPhone(@NotNull String phone);


    CereAgentPrivate selectCereAgentUserByIdAndRoleType(Long agentUserId, Integer lastLoginType);


    Integer updateLoginPassword(@Valid LoginDTO param);

    CereAgentUser selectByUserId(Long agentUserId);

    CereAgentUserVO getRoleById(Long agentUserId, Integer roleType);

    void updateLastLoginIp(Long agentUserId, String ip);

    void updateLastLoginType(Long agentUserId, Integer roleType);

    CereAgentUserVO getUserInfo(Long agentUserId);
}
